<template>
	<view>
		<view class="header">
			<span style="font-size: 18px;float: left;margin-left: 25%;margin-top: 20px;">中国医科大学附属医院</span>
		</view>

<view class="body-hua">
	<view class="body-card">
		<view style="height: 20px;width: 90%;margin: 0 auto;">
			<span style="font-size: 24px;float: left;margin-left: 50px;">Hi！ {{userName}}</span>
		</view>
		<view style="height: 40px;width: 90%;margin: 0 auto;margin-top: 30px;">
			<image src="/static/jhimage/cal.png" style="width: 30px;height: 30px;vertical-align:middle">  </image>
			<span class="now-cll">现在时间：{{now}}</span>
		</view>
		<view style="height: 20px;width: 90%;margin: 0 auto;margin-top: 5px;">
			<span style="font-size: 13px;color: #808080;margin-top: 10px;margin-left: 50px;">这里是中国医科大学附属医院就诊小程序</span>
		</view>
		
	</view>
</view>
		<view class="body">
			<view class="uni-flex uni-column body-col">
				<view class="uni-flex uni-row body-row">
					<view class="body-item">
						<view class="body-left" @click="turnToDoctorRecommend()">
							<image style="width: 50px;height: 50px;" src="/static/jhimage/a1.png"></image></br>
							<span>医生推荐</span>
						</view>
					</view>
					<view class="body-item ">
						<view class="body-center" @click="turnToAIGuidance()">
							<image style="width: 50px;height: 50px;" src="/static/jhimage/a2.png"></image>
							</br>
							<span>智能导诊</span>
						</view>
					</view>
					<view class="body-item ">
						<view class="body-right" @click="turnToPerGuidance()">
							<image style="width: 50px;height: 50px;" src="/static/jhimage/a3.png"></image>
							</br>
							<span>人工导诊</span>
						</view>
					</view>
				</view>
				<view class="uni-flex uni-row body-row" >
					<view class="body-item">
						<view class="body-left" @click="yuyue()">
							<image style="width: 50px;height: 50px;" src="/static/jhimage/a4.png"></image></br>
							<span>预约挂号</span>
						</view>
					</view>
					<view class="body-item ">
						<view class="body-center" @click="baogao()">
							<image style="width: 50px;height: 50px;" src="/static/jhimage/a5.png"></image>
							</br>
							<span>报告查询</span>
						</view>
					</view>
					<view class="body-item ">
						<view class="body-right" @click="wodeguahaoRecored()">
							<image style="width: 50px;height: 50px;" src="/static/jhimage/a6.png"></image>
							</br>
							<span>候诊记录</span>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import currentDate from '@/common/utils/currentDate.js';
	import { error } from '@/common/js/errorTips.js'
	export default {
		data() {
			return {
				background: ['color1', 'color2', 'color3'],
				indicatorDots: true,
				autoplay: true,
				interval: 2000,
				duration: 500,
				now:'',
				isAlreadyLogin: uni.getStorageSync('isAlreadyLogin') || '', // 用于记录是否登录
				userName: '',
				userTrueName:'',
			}
		},
		onLoad(){
			console.log(uni.getStorageSync("userLoginInfo.id"))
			this.getNow();
			this.userName = uni.getStorageSync("userLoginInfo.name")!=undefined?uni.getStorageSync("userLoginInfo.name"):'';
			this.userTrueName = uni.getStorageSync("userLoginInfo.truename")!=undefined?uni.getStorageSync("userLoginInfo.truename"):'';
		},
		onPullDownRefresh() {
			this.isAlreadyLogin = uni.getStorageSync('isAlreadyLogin')
		},
		methods: {
			getNow(){
				var date  = new Date();
				this.now = date.getFullYear()+"年"+Number(Number(date.getMonth())+1)+"月"+date.getDate()+"日";
			},
			turnToDoctorRecommend:function(){
				uni.navigateTo({
					url: '/pages/yuyue/doctorRecommend/inputSymptoms'
				})
			},
			turnToAIGuidance: function() {
				uni.navigateTo({
					url: '/pages/yuyue/chat/components/index?type=' + 'AI'
				})
			},
			turnToPerGuidance: function() {
				uni.navigateTo({
					url: '/pages/yuyue/chat/components/index?type=' + 'AR'
				})
			},
			yuyue(){
				if(uni.getStorageSync('isAlreadyLogin')){
					uni.navigateTo({
						url: '/pages/yuyue/yuyue'
					})
				}else{
					error('请先登录')
				}
			},
			baogao(){
				if(uni.getStorageSync('isAlreadyLogin')){
					console.log("报告111")
					uni.navigateTo({
						url: '/pages/yuyue/baogao'
					})
				} else {
					error('请登录')
				} 
			},
			wodeguahaoRecored(){
				if(uni.getStorageSync('isAlreadyLogin')){
					uni.navigateTo({
						url: '/pages/yuyue/wodeguahaoRecored'
					})
				} else {
					error('请登录')
				} 
			}

		}
	}
</script>

<style scoped>
	.header {
		height: 60px;
		width: auto;
		background-color: #7ec0ee;
		color: #FFFFFF;

	}

	.body {
		height: 250px;

	}


	.uni-flex {
		display: flex;
		flex-direction: row;
	}

	.uni-row {
		flex-direction: row;
	}

	.uni-column {
		flex-direction: column;
	}

	.body-item {
		width: 50%;
		height: 120px;
	}

	.body-left {
		width: 90px;
		height: 90px;

		float: left;
		margin-top: 10px;
		margin-left: 30px;
	}

	.body-center {
		width: 90px;
		height: 90px;

		margin: 0 auto;
		margin-top: 10px;


	}

	.body-right {
		width: 90px;
		height: 90px;
		float: right;
		margin-top: 10px;
		margin-right: 30px;

	}

	
	.body-hua{
		
		height: 200px;
		background-image:url('https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fdata.ac-illust.com%2Fdata%2Fthumbnails%2Fe2%2Fe281c5c5733451ec52dd58c6b970d7b6_t.jpeg&refer=http%3A%2F%2Fdata.ac-illust.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1621583733&t=72b4e9203f4b34ddbdda06bbe417f514')
		;position:relative;
		margin: 0 auto;
		margin-top: 20px;
	}
	
	.body-card{
		position:absolute;
		bottom:0;
		width: 85%;
		height: 130px;
		margin-left: 30px;
		margin-bottom: 40px;
		background-color: #FFFFFF;	
		border-radius:10px;
		filter:progid:DXImageTransform.Microsoft.Shadow(color=#909090,direction=120,strength=4);
	   -moz-box-shadow: 2px 2px 10px #909090;
	   -webkit-box-shadow: 2px 2px 10px #909090;
	   box-shadow:2px 2px 10px #909090;
		
	}
	.now-cll{
		margin-left: 20px;
		margin-top: 10px;
	}
</style>
